package xiaohu.day7.HJ74;

import java.util.LinkedList;
import java.util.Scanner;

public class Main2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLine()) {
            String str = scanner.nextLine();
            int[] arr = new int[str.length()];
            int count = 0;
            for (int i = 0; i < str.length(); i++) {
                if (str.charAt(i)=='"'){
                    arr[i] = 1;
                }
            }
            int first = -1;
            int last = -1;
            LinkedList<String> list = new LinkedList<>();
            for (int i = 0; i < arr.length; i++) {
                if (arr[i]==1){
                    if (first == -1) {
                        first = i;
                    }else if (last == -1){
                        last = i;
                    }
                }
                if (last != -1 && first != -1) {
                    if (first == 0) {
                        String strOut = str.substring(first + 1, last);
                        list.add(strOut);
//                        System.out.println(strOut);
                        first = -1;
                        last = -1;
                        count++;
                    } else {
                        if (count == 0) {
                            String strOut = str.substring(0, first);
                            String[] split = strOut.split(" ");
                            for (int j = 0; j < split.length; j++) {
                                list.add(split[j]);
//                                System.out.println(split[j]);
                            }
                            list.add(str.substring(first + 1, last));
//                            System.out.println(str.substring(first + 1, last));
                            first = -1;
                            last = -1;
                            count++;
                        } else {
                            list.add(str.substring(first + 1, last));
//                            System.out.println(str.substring(first + 1, last));
                            count++;
                            first = -1;
                            last = -1;
                        }
                    }
                }
            }
            if (count == 0) {
                String[] split = str.split(" ");
                System.out.println(split.length);
                for (int j = 0; j < split.length; j++) {
                    System.out.println(split[j]);
                }
            } else {
                System.out.println(list.size());
                for (String s : list) {
                    System.out.println(s);
                }
            }
        }
    }
}
